<template>
    <div>
        <h3>需求 ：Promise 函数封装</h3>
        <img src="@/assets/timu1.png" alt="">
    </div>
</template>

<script>
    export default {
        name: "PromiseView",
        methods :{
            handleRequest(){
                return new Promise((resolve,reject) => {
                    wx.request({
                        url : "test",
                        data:{
                            test :"test"
                        },
                        success(res){
                            // console.log(res)
                            resolve(res)
                        },
                        fail(err){
                            // console.log(err)
                            reject(err)
                        }
                    })
                })
            }
        }
    }
</script>

<style scoped>

</style>